<?php
include("connection.php"); 
$g=$_GET["q"];

$query = "SELECT airline_name as caption, airline_code as value from airline_new WHERE airline_name LIKE '%$g%' or airline_code LIKE '%$g%' ORDER BY airline_rank ASC LIMIT 10";

$arr = array();
$rs = mysql_query($query);
$i=0;
while($obj = mysql_fetch_object($rs))
{
    $arr[$i]["caption"] = $obj->caption."(".$obj->value.")";
	$arr[$i]["value"]=$obj->value;
	$i++;
}

echo json_encode($arr);
mysql_close($con);
?>
 